package com.gitee.neuray.security.mail.hystrix;

import com.gitee.neuray.security.common.msg.ObjectRestResponse;
import com.gitee.neuray.security.mail.feign.MailServiceFeignClient;
import com.gitee.neuray.security.mail.vo.SysMailSourceVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @auther: zhuqz
 * @date: 2020/3/1 17:30
 * @description: 邮件降级服务
 */
@Component
@Slf4j
public class MailSeriviceFallback implements MailServiceFeignClient {
    @Override
    public ObjectRestResponse addMail(SysMailSourceVo vo) {
        log.error("mail api 服务中的方法{}出现错误,已经被降级处理...","addMail");
        return new ObjectRestResponse().rel(false).msg("500").data("降级处理");
    }

    @Override
    public ObjectRestResponse sendTimerMail() {
        log.error("mail api 服务中的方法{}出现错误,已经被降级处理...","sendTimerMail");
        return new ObjectRestResponse().rel(false).msg("500").data("降级处理");
    }
    @Override
    public ObjectRestResponse addBirthDayTimerMail() {
        log.error("mail api 服务中的方法{}出现错误,已经被降级处理...","addBirthDayTimerMail");
        return new ObjectRestResponse().rel(false).msg("500").data("降级处理");
    }
}